package com.wyg.service;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wyg.dao.UserDao;

import netscape.javascript.JSObject;

public class UserOperationService {
	public HttpServletRequest request;
	public HttpServletResponse response;
	public UserDao ud = new UserDao();
	
	public UserOperationService(HttpServletRequest request, HttpServletResponse response) {
		super();
		this.request = request;
		this.response = response;
	}
	
	public void deleteUser(){
		System.out.println("deleteUser-------Service");
		int id =Integer.parseInt(request.getParameter("id"));
		ud.deleteUser(id);
		
		try {
			PrintWriter out = response.getWriter();
			out.print("success");
			out.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
	
}
